
/*
    Software License

    Copyright (C) 2021-05-24  Xoronos

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, version 3.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

/*
    Liabilities

    The software is provided "AS IS" without any warranty of any kind, either expressed,
    implied, or statutory, including, but not limited to, any warranty that the software
    will conform to specifications, any implied warranties of merchantability, fitness
    for a particular purpose, and freedom from infringement, and any warranty that the
    documentation will conform to the software, or any warranty that the software will
    be error free.

    In no event shall Xoronos be liable for any damages, including, but not limited to,
    direct, indirect, special or consequential damages, arising out of, resulting from,
    or in any way connected with this software, whether or not based upon warranty,
    contract, tort, or otherwise, whether or not injury was sustained by persons or
    property or otherwise, and whether or not loss was sustained from, or arose out of
    the results of, or use of, the software or services provided hereunder.

    To request the provided software under a different license you can contact us at
    support@xoronos.com
*/

#include "xgenesis_bases_init.h"

void xgenesis_base_init( xgenesis_base_t * obase
 )
{

#if XNBITS == 256

    // initialize origin base
    xrn_initialize_genesis_base( obase );

    obase->base_vector[30] = 0x01;      //240
    obase->base_vector[22] = 0x02;      //177
    obase->base_vector[15] = 0x01;      //120

#elif XNBITS == 128

    xrn_initialize_genesis_base( obase );

    obase->base_vector[9] = 0x40;
    obase->base_vector[11] = 0x02;
    obase->base_vector[12] = 0x08;
    obase->base_vector[15] = 0x80;
    obase->base_vector[22] = 0x50;
    obase->base_vector[23] = 0x80;
    obase->base_vector[30] = 0x01;
    obase->base_vector[37] = 0x02;
    obase->base_vector[38] = 0x80;
    obase->base_vector[40] = 0x20;
    obase->base_vector[41] = 0x08;
    obase->base_vector[46] = 0x10;
    obase->base_vector[52] = 0x20;
    obase->base_vector[54] = 0x28;
    obase->base_vector[57] = 0x40;
    obase->base_vector[59] = 0x40;
    obase->base_vector[69] = 0x10;
    obase->base_vector[70] = 0x08;
    obase->base_vector[73] = 0x40;
    obase->base_vector[76] = 0x04;
    obase->base_vector[78] = 0x02;
    obase->base_vector[85] = 0x40;
    obase->base_vector[86] = 0x40;
    obase->base_vector[93] = 0x08;
    obase->base_vector[102] = 0x20;
    obase->base_vector[107] = 0x40;
    obase->base_vector[108] = 0x10;
    obase->base_vector[109] = 0x01;
    obase->base_vector[116] = 0x30;
    obase->base_vector[118] = 0x80;
    obase->base_vector[120] = 0x10;
    obase->base_vector[132] = 0x10;
    obase->base_vector[133] = 0x10;
    obase->base_vector[138] = 0x02;
    obase->base_vector[139] = 0x04;
    obase->base_vector[146] = 0x01;
    obase->base_vector[147] = 0x04;
    obase->base_vector[149] = 0x14;
    obase->base_vector[164] = 0x05;
    obase->base_vector[166] = 0x28;
    obase->base_vector[167] = 0x01;
    obase->base_vector[173] = 0x20;
    obase->base_vector[174] = 0x80;
    obase->base_vector[175] = 0x02;
    obase->base_vector[178] = 0x80;
    obase->base_vector[180] = 0x02;
    obase->base_vector[188] = 0x02;
    obase->base_vector[189] = 0x80;
    obase->base_vector[192] = 0x20;
    obase->base_vector[193] = 0x01;
    obase->base_vector[198] = 0x01;
    obase->base_vector[209] = 0x40;
    obase->base_vector[210] = 0x80;
    obase->base_vector[212] = 0x02;
    obase->base_vector[217] = 0x02;
    obase->base_vector[220] = 0x01;
    obase->base_vector[225] = 0x02;
    obase->base_vector[234] = 0x80;
    obase->base_vector[236] = 0x10;
    obase->base_vector[240] = 0x03;
    obase->base_vector[249] = 0x15;
    obase->base_vector[252] = 0x01;
    obase->base_vector[254] = 0x20;
    obase->base_vector[259] = 0x04;
    obase->base_vector[262] = 0x20;
    obase->base_vector[264] = 0x04;
    obase->base_vector[272] = 0x40;
    obase->base_vector[277] = 0x20;
    obase->base_vector[278] = 0x20;
    obase->base_vector[279] = 0x82;
    obase->base_vector[286] = 0x08;
    obase->base_vector[290] = 0x20;
    obase->base_vector[291] = 0x01;
    obase->base_vector[301] = 0x30;
    obase->base_vector[302] = 0x42;
    obase->base_vector[303] = 0x04;
    obase->base_vector[314] = 0x01;
    obase->base_vector[318] = 0x80;
    obase->base_vector[320] = 0x40;
    obase->base_vector[321] = 0x22;
    obase->base_vector[327] = 0x40;
    obase->base_vector[328] = 0x40;
    obase->base_vector[329] = 0x08;
    obase->base_vector[333] = 0x40;
    obase->base_vector[334] = 0x10;
    obase->base_vector[341] = 0x20;
    obase->base_vector[343] = 0x02;
    obase->base_vector[347] = 0x04;
    obase->base_vector[353] = 0x20;
    obase->base_vector[355] = 0x08;
    obase->base_vector[356] = 0x08;
    obase->base_vector[358] = 0x02;
    obase->base_vector[366] = 0x01;
    obase->base_vector[367] = 0x10;
    obase->base_vector[370] = 0x20;
    obase->base_vector[372] = 0x10;
    obase->base_vector[374] = 0x04;
    obase->base_vector[381] = 0x08;
    obase->base_vector[383] = 0x04;
    obase->base_vector[387] = 0x20;
    obase->base_vector[396] = 0x08;
    obase->base_vector[397] = 0x04;
    obase->base_vector[398] = 0x80;
    obase->base_vector[400] = 0x04;
    obase->base_vector[404] = 0x08;
    obase->base_vector[406] = 0x40;
    obase->base_vector[410] = 0x82;
    obase->base_vector[415] = 0x02;
    obase->base_vector[416] = 0x04;
    obase->base_vector[422] = 0x04;
    obase->base_vector[424] = 0x02;
    obase->base_vector[428] = 0x04;
    obase->base_vector[431] = 0x80;
    obase->base_vector[437] = 0x04;
    obase->base_vector[440] = 0x08;
    obase->base_vector[441] = 0x40;
    obase->base_vector[442] = 0x80;
    obase->base_vector[447] = 0x04;
    obase->base_vector[448] = 0x04;
    obase->base_vector[454] = 0x20;
    obase->base_vector[455] = 0x40;
    obase->base_vector[456] = 0x02;
    obase->base_vector[457] = 0x02;
    obase->base_vector[459] = 0x10;
    obase->base_vector[464] = 0x04;
    obase->base_vector[468] = 0x10;
    obase->base_vector[473] = 0x2c;
    obase->base_vector[476] = 0x10;
    obase->base_vector[480] = 0x40;
    obase->base_vector[482] = 0x80;
    obase->base_vector[487] = 0x40;
    obase->base_vector[489] = 0x01;
    obase->base_vector[490] = 0x20;
    obase->base_vector[491] = 0x80;
    obase->base_vector[495] = 0x08;
    obase->base_vector[498] = 0x22;
    obase->base_vector[502] = 0x10;
    obase->base_vector[512] = 0x03;
    obase->base_vector[515] = 0x40;
    obase->base_vector[521] = 0x04;
    obase->base_vector[528] = 0x02;
    obase->base_vector[529] = 0x01;
    obase->base_vector[532] = 0x04;
    obase->base_vector[533] = 0x04;
    obase->base_vector[536] = 0x20;
    obase->base_vector[537] = 0x02;
    obase->base_vector[542] = 0x01;
    obase->base_vector[543] = 0x20;
    obase->base_vector[547] = 0x04;
    obase->base_vector[549] = 0x44;
    obase->base_vector[550] = 0x40;
    obase->base_vector[553] = 0x40;
    obase->base_vector[557] = 0x08;
    obase->base_vector[561] = 0x10;
    obase->base_vector[563] = 0x01;

#elif XNBITS == 16
    // initialize origin base
    xrn_initialize_genesis_base( obase );
    obase->base_vector[0] = 0x42;       //2 - 4
    obase->base_vector[1] = 0x08;       //11 
#endif

    return;
}

void initilize_enc_param( xrn_encoding_param_t * enc_param
 )
{

    ( ( uint8_t * ) & enc_param->prng_state[0] )[0] = 71;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[1] = 206;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[2] = 54;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[3] = 134;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[4] = 133;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[5] = 244;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[6] = 84;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[7] = 178;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[8] = 234;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[9] = 176;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[10] = 197;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[11] = 95;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[12] = 109;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[13] = 248;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[14] = 173;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[15] = 96;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[16] = 90;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[17] = 3;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[18] = 164;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[19] = 218;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[20] = 94;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[21] = 125;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[22] = 22;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[23] = 98;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[24] = 233;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[25] = 149;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[26] = 247;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[27] = 170;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[28] = 59;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[29] = 133;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[30] = 55;
    ( ( uint8_t * ) & enc_param->prng_state[0] )[31] = 17;

    // enc_param->table[0] = 0;
    enc_param->table[0] = 11;
    enc_param->table[1] = 79;
    enc_param->table[2] = 244;
    enc_param->table[3] = 234;
    enc_param->table[4] = 239;
    enc_param->table[5] = 232;
    enc_param->table[6] = 167;
    enc_param->table[7] = 225;
    enc_param->table[8] = 230;
    enc_param->table[9] = 203;
    enc_param->table[10] = 197;
    enc_param->table[11] = 194;
    enc_param->table[12] = 215;
    enc_param->table[13] = 208;
    enc_param->table[14] = 217;
    enc_param->table[15] = 222;
    enc_param->table[16] = 131;
    enc_param->table[17] = 132;
    enc_param->table[18] = 141;
    enc_param->table[19] = 138;
    enc_param->table[20] = 159;
    enc_param->table[21] = 152;
    enc_param->table[22] = 145;
    enc_param->table[23] = 150;
    enc_param->table[24] = 187;
    enc_param->table[25] = 188;
    enc_param->table[26] = 181;
    enc_param->table[27] = 178;
    enc_param->table[28] = 253;
    enc_param->table[29] = 160;
    enc_param->table[30] = 169;
    enc_param->table[31] = 174;
    enc_param->table[32] = 19;
    enc_param->table[33] = 20;
    enc_param->table[34] = 29;
    enc_param->table[35] = 26;
    enc_param->table[36] = 15;
    enc_param->table[37] = 8;
    enc_param->table[38] = 1;
    enc_param->table[39] = 6;
    enc_param->table[40] = 43;
    enc_param->table[41] = 44;
    enc_param->table[42] = 37;
    enc_param->table[43] = 34;
    enc_param->table[44] = 55;
    enc_param->table[45] = 48;
    enc_param->table[46] = 57;
    enc_param->table[47] = 62;
    enc_param->table[48] = 100;
    enc_param->table[49] = 109;
    enc_param->table[50] = 106;
    enc_param->table[51] = 127;
    enc_param->table[52] = 120;
    enc_param->table[53] = 113;
    enc_param->table[54] = 118;
    enc_param->table[55] = 91;
    enc_param->table[56] = 99;
    enc_param->table[57] = 92;
    enc_param->table[58] = 85;
    enc_param->table[59] = 51;
    enc_param->table[60] = 82;
    enc_param->table[61] = 71;
    enc_param->table[62] = 64;
    enc_param->table[63] = 73;
    enc_param->table[64] = 78;
    enc_param->table[65] = 52;
    enc_param->table[66] = 207;
    enc_param->table[67] = 58;
    enc_param->table[68] = 61;
    enc_param->table[69] = 40;
    enc_param->table[70] = 47;
    enc_param->table[71] = 38;
    enc_param->table[72] = 33;
    enc_param->table[73] = 12;
    enc_param->table[74] = 11;
    enc_param->table[75] = 2;
    enc_param->table[76] = 5;
    enc_param->table[77] = 16;
    enc_param->table[78] = 23;
    enc_param->table[79] = 30;
    enc_param->table[80] = 68;
    enc_param->table[81] = 67;
    enc_param->table[82] = 74;
    enc_param->table[83] = 77;
    enc_param->table[84] = 88;
    enc_param->table[85] = 95;
    enc_param->table[86] = 86;
    enc_param->table[87] = 81;
    enc_param->table[88] = 124;
    enc_param->table[89] = 123;
    enc_param->table[90] = 114;
    enc_param->table[91] = 117;
    enc_param->table[92] = 96;
    enc_param->table[93] = 103;
    enc_param->table[94] = 110;
    enc_param->table[95] = 105;
    enc_param->table[96] = 212;
    enc_param->table[97] = 211;
    enc_param->table[98] = 218;
    enc_param->table[99] = 221;
    enc_param->table[100] = 200;
    enc_param->table[101] = 198;
    enc_param->table[102] = 193;
    enc_param->table[103] = 236;
    enc_param->table[104] = 235;
    enc_param->table[105] = 226;
    enc_param->table[106] = 229;
    enc_param->table[107] = 240;
    enc_param->table[108] = 247;
    enc_param->table[109] = 177;
    enc_param->table[110] = 254;
    enc_param->table[111] = 249;
    enc_param->table[112] = 164;
    enc_param->table[113] = 163;
    enc_param->table[114] = 170;
    enc_param->table[115] = 173;
    enc_param->table[116] = 184;
    enc_param->table[117] = 191;
    enc_param->table[118] = 182;
    enc_param->table[119] = 156;
    enc_param->table[120] = 155;
    enc_param->table[121] = 146;
    enc_param->table[122] = 149;
    enc_param->table[123] = 128;
    enc_param->table[124] = 135;
    enc_param->table[125] = 142;
    enc_param->table[126] = 137;
    enc_param->table[127] = 122;
    enc_param->table[128] = 125;
    enc_param->table[129] = 80;
    enc_param->table[130] = 116;
    enc_param->table[131] = 115;
    enc_param->table[132] = 102;
    enc_param->table[133] = 97;
    enc_param->table[134] = 104;
    enc_param->table[135] = 111;
    enc_param->table[136] = 66;
    enc_param->table[137] = 69;
    enc_param->table[138] = 76;
    enc_param->table[139] = 75;
    enc_param->table[140] = 94;
    enc_param->table[141] = 89;
    enc_param->table[142] = 87;
    enc_param->table[143] = 10;
    enc_param->table[144] = 13;
    enc_param->table[145] = 4;
    enc_param->table[146] = 32;
    enc_param->table[147] = 3;
    enc_param->table[148] = 22;
    enc_param->table[149] = 17;
    enc_param->table[150] = 24;
    enc_param->table[151] = 31;
    enc_param->table[152] = 50;
    enc_param->table[153] = 53;
    enc_param->table[154] = 60;
    enc_param->table[155] = 148;
    enc_param->table[156] = 59;
    enc_param->table[157] = 46;
    enc_param->table[158] = 41;
    enc_param->table[159] = 39;
    enc_param->table[160] = 154;
    enc_param->table[161] = 157;
    enc_param->table[162] = 147;
    enc_param->table[163] = 134;
    enc_param->table[164] = 202;
    enc_param->table[165] = 129;
    enc_param->table[166] = 136;
    enc_param->table[167] = 143;
    enc_param->table[168] = 162;
    enc_param->table[169] = 206;
    enc_param->table[170] = 165;
    enc_param->table[171] = 172;
    enc_param->table[172] = 171;
    enc_param->table[173] = 190;
    enc_param->table[174] = 185;
    enc_param->table[175] = 176;
    enc_param->table[176] = 183;
    enc_param->table[177] = 237;
    enc_param->table[178] = 228;
    enc_param->table[179] = 227;
    enc_param->table[180] = 246;
    enc_param->table[181] = 241;
    enc_param->table[182] = 248;
    enc_param->table[183] = 255;
    enc_param->table[184] = 210;
    enc_param->table[185] = 213;
    enc_param->table[186] = 220;
    enc_param->table[187] = 219;
    enc_param->table[188] = 201;
    enc_param->table[189] = 192;
    enc_param->table[190] = 199;
    enc_param->table[191] = 189;
    enc_param->table[192] = 186;
    enc_param->table[193] = 179;
    enc_param->table[194] = 180;
    enc_param->table[195] = 161;
    enc_param->table[196] = 166;
    enc_param->table[197] = 175;
    enc_param->table[198] = 168;
    enc_param->table[199] = 133;
    enc_param->table[200] = 130;
    enc_param->table[201] = 139;
    enc_param->table[202] = 140;
    enc_param->table[203] = 153;
    enc_param->table[204] = 158;
    enc_param->table[205] = 151;
    enc_param->table[206] = 144;
    enc_param->table[207] = 205;
    enc_param->table[208] = 252;
    enc_param->table[209] = 195;
    enc_param->table[210] = 196;
    enc_param->table[211] = 209;
    enc_param->table[212] = 214;
    enc_param->table[213] = 223;
    enc_param->table[214] = 216;
    enc_param->table[215] = 245;
    enc_param->table[216] = 119;
    enc_param->table[217] = 242;
    enc_param->table[218] = 83;
    enc_param->table[219] = 251;
    enc_param->table[220] = 65;
    enc_param->table[221] = 233;
    enc_param->table[222] = 238;
    enc_param->table[223] = 231;
    enc_param->table[224] = 224;
    enc_param->table[225] = 93;
    enc_param->table[226] = 90;
    enc_param->table[227] = 84;
    enc_param->table[228] = 70;
    enc_param->table[229] = 72;
    enc_param->table[230] = 101;
    enc_param->table[231] = 98;
    enc_param->table[232] = 107;
    enc_param->table[233] = 108;
    enc_param->table[234] = 121;
    enc_param->table[235] = 126;
    enc_param->table[236] = 36;
    enc_param->table[237] = 112;
    enc_param->table[238] = 45;
    enc_param->table[239] = 63;
    enc_param->table[240] = 42;
    enc_param->table[241] = 35;
    enc_param->table[242] = 49;
    enc_param->table[243] = 54;
    enc_param->table[244] = 204;
    enc_param->table[245] = 56;
    enc_param->table[246] = 25;
    enc_param->table[247] = 250;
    enc_param->table[248] = 21;
    enc_param->table[249] = 18;
    enc_param->table[250] = 27;
    enc_param->table[251] = 28;
    enc_param->table[252] = 9;
    enc_param->table[253] = 14;
    enc_param->table[254] = 7;
    enc_param->table[255] = 243;

    return;

}

